package com.ruoyi.thread.entity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;

// 用户仪表板（聚合数据）
@Data
@AllArgsConstructor
@NoArgsConstructor
public class UserDashboard {
    private User user;
    private List<Order> recentOrders;
    private List<Message> unreadMessages;
    private UserStats stats;
    private List<Product> recommendedProducts;
    
    // 降级构造方法
    public static UserDashboard fallback(Long userId) {
        User user = new User(userId, "用户" + userId, "fallback@example.com", 
                           "00000000000", 0, "默认地址", LocalDateTime.now(), User.UserStatus.ACTIVE);
        return new UserDashboard(user, new ArrayList<>(), new ArrayList<>(),
                               new UserStats(userId, 0, BigDecimal.ZERO, 0, LocalDateTime.now(), 0), 
                               new ArrayList<>());
    }
}
